<template>
<div class="page fireDrawing-page" data-page="fireDrawing"
	style="z-index: 2;">
	<div class="link-page-nav">
		<a href="#" class="link" @click="$root.backToTab()"> <i
			class="iconfont icon-zuo"></i>
		</a>
	</div>
	<div class="link-page-top" style="padding-bottom: 17px;">
		<div class="link-page-title">消防图纸</div>
	</div>
	<div class="page-content" style="padding-bottom: 100px;">
		<div class="page-draw-list">
			<div class="draw-type-item">
				<div class="type-name">总平面布置图</div>
				<div id="picturesUrl_file"></div>
			</div>
			<div class="draw-type-item">
				<div class="type-name">其它图纸</div>
				<div id="building-fire-picUrl"></div>
			</div>
		</div>
	</div>
</div>
</template>

<script>
	return {
		data : function() {
			return {
				picturesUrl:decodeURIComponent(this.$route.params.picturesUrl),
				drawingPicturesUrls:decodeURIComponent(this.$route.params.drawingPicturesUrls), // 其它图
			}
		},
		methods : {
			htmlPage:function(){
				var self = this;
				$("#picturesUrl_file").empty();
				$("#building-fire-picUrl").empty();
				// $("#safety-exit-layout").empty();
				// $("#fireSystemPicUrl").empty();
				
				if(self.picturesUrl.length > 0) {
					var urls = self.picturesUrl.split(",");
					for(var i=0;i<urls.length;i++){
						$("#picturesUrl_file").append(`<img src="`+urls[i]+`" class="fire-pic">`);
					}
					
					jQuery("#picturesUrl_file").off().click(function(e){
						openAndShowBigImage(urls,0);
					});
				} else {
					$("#picturesUrl_file").append(`<img src="http://unit.dzxyhgy.kdlayun.com/rdspZd/resources/images/unitInfor/no_book.png">`);
				}
				
				if(self.drawingPicturesUrls.length > 0) {
					var bUrls = self.drawingPicturesUrls.split(",");
					for(var i=0;i<bUrls.length;i++){
						$("#building-fire-picUrl").append(`<img src="`+bUrls[i]+`" class="fire-pic">`);
					}
					
					jQuery("#building-fire-picUrl").off().click(function(e){
						openAndShowBigImage(bUrls,0);
					});

				} else {
					$("#building-fire-picUrl").append(`<img src="http://unit.dzxyhgy.kdlayun.com/rdspZd/resources/images/unitInfor/no_book.png">`);
				}
			},
		},
		on : {
			pageInit : function(e, page) {
				var self = this;
				self.htmlPage();
			}
		}
	}
</script>

<style scoped>
.page-draw-list {
	margin: 0px 20px 20px 20px;
}

.draw-type-item .type-name {
	font-size: 17px;
	font-family: PingFangSC-Semibold;
	font-weight: 600;
	color: rgba(51, 51, 51, 1);
	line-height: 35px;
	padding-bottom: 15px;
}

.draw-type-item {
	margin-bottom: 15px;
}

.draw-type-item img {
	width: 30%;
	margin: 1%;
	height: 70px;
}
</style>